package org.msn.component;

import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;

public class SelfMessageHBox extends MessageHBox {
    public SelfMessageHBox(String name, String msg) {
        super(name, msg);
        slot();
    }

    private void slot() {
        setPadding(new Insets(10, 0, 0, 0));

        BorderPane otherPane = new BorderPane();
        otherPane.setPrefWidth(getPaneWidth());
        otherPane.setPrefHeight(getPaneHeight());

        BorderPane msgPane = new MessageBorderPane(getMsg());

        BorderPane namePane = new BorderPane();
        namePane.setPrefWidth(getPaneWidth());
        namePane.setPrefHeight(getPaneHeight());
        namePane.setLeft(new Label(getName()));

        getChildren().addAll(otherPane, msgPane, namePane);
    }
}
